package ws.very.util.dingtalk.api

import com.dingtalk.open.client.ServiceFactory
import com.dingtalk.open.client.api.service.corp.CorpUserService

import scala.concurrent.{ExecutionContext, Future}

private[dingtalk] object CorpUserServiceHelper {

  val corpUserService = ServiceFactory.getInstance.getOpenService(classOf[CorpUserService])

  def getUserInfo(accessToken: S, code: S)(implicit executor: ExecutionContext) = Future {
    corpUserService.getUserinfo(accessToken, code)
  }

}
